home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 February: Tool Chest / Apple Developer CD Series Tool Chest February 1996 (Apple Computer)(1996).iso / What's New? / Development Kits / ColorSync™ 2.0.1 GM / Interfaces / PInterfaces / CMApplication.p < prev    next >
Encoding:
Text File  |  1995-12-12  |  26.5 KB  |  863 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        CMApplication.p
  3.  
  4.      Contains:    Color Matching Interfaces
  5.  
  6.      Version:    Technology:    ColorSync 2.0
  7.                  Release:    2.0f3
  8.  
  9.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  10.                  All rights reserved.
  11.  
  12.      Bugs?:        If you find a problem with this file, send the file and version
  13.                  information (from above) and the problem description to:
  14.  
  15.                      Internet:    apple.bugs@applelink.apple.com
  16.                      AppleLink:    APPLE.BUGS
  17.  
  18. }
  19.  
  20. {$IFC UNDEFINED UsingIncludes}
  21. {$SETC UsingIncludes := 0}
  22. {$ENDC}
  23.  
  24. {$IFC NOT UsingIncludes}
  25.  UNIT CMApplication;
  26.  INTERFACE
  27. {$ENDC}
  28.  
  29. {$IFC UNDEFINED __CMAPPLICATION__}
  30. {$SETC __CMAPPLICATION__ := 1}
  31.  
  32. {$I+}
  33. {$SETC CMApplicationIncludes := UsingIncludes}
  34. {$SETC UsingIncludes := 1}
  35.  
  36.  
  37. {$IFC UNDEFINED __TYPES__}
  38. {$I Types.p}
  39. {$ENDC}
  40. {    ConditionalMacros.p                                            }
  41.  
  42. {$IFC UNDEFINED __QUICKDRAW__}
  43. {$I Quickdraw.p}
  44. {$ENDC}
  45. {    MixedMode.p                                                    }
  46. {    QuickdrawText.p                                                }
  47. {        ScriptLayout.p                                            }
  48.  
  49. {$IFC UNDEFINED __FILES__}
  50. {$I Files.p}
  51. {$ENDC}
  52. {    OSUtils.p                                                    }
  53. {        Memory.p                                                }
  54. {    Finder.p                                                    }
  55.  
  56. {$IFC UNDEFINED __PRINTING__}
  57. {$I Printing.p}
  58. {$ENDC}
  59. {    Errors.p                                                    }
  60. {    Dialogs.p                                                    }
  61. {        Windows.p                                                }
  62. {            Events.p                                            }
  63. {            Controls.p                                            }
  64. {                Collections.p                                    }
  65. {                Appearance.p                                    }
  66. {                TextObjects.p                                    }
  67. {                    Unicode.p                                    }
  68. {                Menus.p                                            }
  69. {            AppleEvents.p                                        }
  70. {                EPPC.p                                            }
  71. {                    AppleTalk.p                                    }
  72. {                    PPCToolbox.p                                }
  73. {                    Processes.p                                    }
  74. {                Notification.p                                    }
  75. {                    Kernel.p                                    }
  76. {                        MachineExceptions.p                        }
  77. {                        Timing.p                                }
  78. {            Drag.p                                                }
  79. {                TextEdit.p                                        }
  80.  
  81. {$IFC UNDEFINED __CMICCPROFILE__}
  82. {$I CMICCProfile.p}
  83. {$ENDC}
  84.  
  85. {$PUSH}
  86. {$ALIGN MAC68K}
  87. {$LibExport+}
  88.  
  89. CONST
  90.     gestaltColorSync20            = $0200;
  91.  
  92.     kDefaultCMMSignature        = 'appl';
  93.  
  94. { Macintosh 68K trap word }
  95.     cmTrap                        = $ABEE;
  96.  
  97. { PicComment IDs }
  98.     cmBeginProfile                = 220;
  99.     cmEndProfile                = 221;
  100.     cmEnableMatching            = 222;
  101.     cmDisableMatching            = 223;
  102.     cmComment                    = 224;
  103.  
  104. { PicComment selectors for cmComment }
  105.     cmBeginProfileSel            = 0;
  106.     cmContinueProfileSel        = 1;
  107.     cmEndProfileSel                = 2;
  108.  
  109. { Defines for version 1.0 CMProfileSearchRecord.fieldMask }
  110.     cmMatchCMMType                = $00000001;
  111.     cmMatchApplProfileVersion    = $00000002;
  112.     cmMatchDataType                = $00000004;
  113.     cmMatchDeviceType            = $00000008;
  114.     cmMatchDeviceManufacturer    = $00000010;
  115.     cmMatchDeviceModel            = $00000020;
  116.     cmMatchDeviceAttributes        = $00000040;
  117.     cmMatchFlags                = $00000080;
  118.     cmMatchOptions                = $00000100;
  119.     cmMatchWhite                = $00000200;
  120.     cmMatchBlack                = $00000400;
  121.  
  122. { Defines for version 2.0 CMSearchRecord.searchMask }
  123.     cmMatchAnyProfile            = $00000000;
  124.     cmMatchProfileCMMType        = $00000001;
  125.     cmMatchProfileClass            = $00000002;
  126.     cmMatchDataColorSpace        = $00000004;
  127.     cmMatchProfileConnectionSpace = $00000008;
  128.     cmMatchManufacturer            = $00000010;
  129.     cmMatchModel                = $00000020;
  130.     cmMatchAttributes            = $00000040;
  131.     cmMatchProfileFlags            = $00000080;
  132.  
  133. { Result codes }
  134. { General Errors }
  135.     cmProfileError                = -170;
  136.     cmMethodError                = -171;
  137.     cmMethodNotFound            = -175;                            { CMM not present }
  138.     cmProfileNotFound            = -176;                            { Responder error }
  139.     cmProfilesIdentical            = -177;                            { Profiles the same }
  140.     cmCantConcatenateError        = -178;                            { Profile can't be concatenated }
  141.     cmCantXYZ                    = -179;                            { CMM cant handle XYZ space }
  142.     cmCantDeleteProfile            = -180;                            { Responder error }
  143.     cmUnsupportedDataType        = -181;                            { Responder error }
  144.     cmNoCurrentProfile            = -182;                            { Responder error }
  145. { Profile Access Errors }
  146.     cmElementTagNotFound        = -4200;
  147.     cmIndexRangeErr                = -4201;                        { Index out of range }
  148.     cmCantDeleteElement            = -4202;
  149.     cmFatalProfileErr            = -4203;
  150.     cmInvalidProfile            = -4204;                        { A Profile must contain a 'cs1 ' tag to be valid }
  151.     cmInvalidProfileLocation    = -4205;                        { Operation not supported for this profile location }
  152. { Profile Search Errors }
  153.     cmInvalidSearch                = -4206;                        { Bad Search Handle }
  154.     cmSearchError                = -4207;
  155.     cmErrIncompatibleProfile    = -4208;
  156. { Other ColorSync Errors }
  157.     cmInvalidColorSpace            = -4209;                        { Profile colorspace does not match bitmap type }
  158.     cmInvalidSrcMap                = -4210;                        { Source pix/bit map was invalid }
  159.     cmInvalidDstMap                = -4211;                        { Destination pix/bit map was invalid }
  160.     cmNoGDevicesError            = -4212;                        { Begin/End Matching -- no gdevices available }
  161.     cmInvalidProfileComment        = -4213;                        { Bad Profile comment during drawpicture }
  162. { Color Conversion Errors }
  163.     cmRangeOverFlow                = -4214;                        { One or more output color value overflows in color conversion 
  164.                                                         all input color values will still be converted, and the overflown 
  165.                                                         will be clipped }
  166. { Other Profile Access Errors }
  167.     cmCantCopyModifiedV1Profile    = -4215;                        { It is illegal to copy version 1 profiles that  
  168.                                                         have been modified }
  169.  
  170. { deviceType values for ColorSync 1.0 Device Profile access }
  171.     cmSystemDevice                = 'sys ';
  172.     cmGDevice                    = 'gdev';
  173.  
  174. { Commands for CMFlattenUPP(…) }
  175.     cmOpenReadSpool                = 1;
  176.     cmOpenWriteSpool            = 2;
  177.     cmReadSpool                    = 3;
  178.     cmWriteSpool                = 4;
  179.     cmCloseSpool                = 5;
  180.  
  181. { Flags for PostScript-related functions }
  182.     cmPS7bit                    = 1;
  183.     cmPS8bit                    = 2;
  184.  
  185.     
  186. TYPE
  187.     CMProfileRef = Ptr;
  188.  
  189. { Abstract data type for Profile search result }
  190.     CMProfileSearchRef = Ptr;
  191.  
  192. { Abstract data type for BeginMatching(…) reference }
  193.     CMMatchRef = Ptr;
  194.  
  195. { Abstract data type for ColorWorld reference }
  196.     CMWorldRef = Ptr;
  197.  
  198. { Caller-supplied progress function for Bitmap & PixMap matching routines }
  199. { Caller-supplied filter function for Profile search }
  200.     CMFlattenProcPtr = ProcPtr;  { FUNCTION CMFlatten(command: LONGINT; VAR size: LONGINT; data: UNIV Ptr; refCon: UNIV Ptr): OSErr; }
  201.     CMBitmapCallBackProcPtr = ProcPtr;  { FUNCTION CMBitmapCallBack(progress: LONGINT; refCon: UNIV Ptr): BOOLEAN; }
  202.     CMProfileFilterProcPtr = ProcPtr;  { FUNCTION CMProfileFilter(prof: CMProfileRef; refCon: UNIV Ptr): BOOLEAN; }
  203.     CMFlattenUPP = UniversalProcPtr;
  204.     CMBitmapCallBackUPP = UniversalProcPtr;
  205.     CMProfileFilterUPP = UniversalProcPtr;
  206.  
  207. CONST
  208.     uppCMFlattenProcInfo = $00003FE0; { FUNCTION (4 byte param, 4 byte param, 4 byte param, 4 byte param): 2 byte result; }
  209.     uppCMBitmapCallBackProcInfo = $000003D0; { FUNCTION (4 byte param, 4 byte param): 1 byte result; }
  210.     uppCMProfileFilterProcInfo = $000003D0; { FUNCTION (4 byte param, 4 byte param): 1 byte result; }
  211.  
  212. FUNCTION NewCMFlattenProc(userRoutine: CMFlattenProcPtr): CMFlattenUPP;
  213.     {$IFC NOT GENERATINGCFM }
  214.     INLINE $2E9F;
  215.     {$ENDC}
  216.  
  217. FUNCTION NewCMBitmapCallBackProc(userRoutine: CMBitmapCallBackProcPtr): CMBitmapCallBackUPP;
  218.     {$IFC NOT GENERATINGCFM }
  219.     INLINE $2E9F;
  220.     {$ENDC}
  221.  
  222. FUNCTION NewCMProfileFilterProc(userRoutine: CMProfileFilterProcPtr): CMProfileFilterUPP;
  223.     {$IFC NOT GENERATINGCFM }
  224.     INLINE $2E9F;
  225.     {$ENDC}
  226.  
  227. FUNCTION CallCMFlattenProc(command: LONGINT; VAR size: LONGINT; data: UNIV Ptr; refCon: UNIV Ptr; userRoutine: CMFlattenUPP): OSErr;
  228.     {$IFC NOT GENERATINGCFM}
  229.     INLINE $205F, $4E90;
  230.     {$ENDC}
  231.  
  232. FUNCTION CallCMBitmapCallBackProc(progress: LONGINT; refCon: UNIV Ptr; userRoutine: CMBitmapCallBackUPP): BOOLEAN;
  233.     {$IFC NOT GENERATINGCFM}
  234.     INLINE $205F, $4E90;
  235.     {$ENDC}
  236.  
  237. FUNCTION CallCMProfileFilterProc(prof: CMProfileRef; refCon: UNIV Ptr; userRoutine: CMProfileFilterUPP): BOOLEAN;
  238.     {$IFC NOT GENERATINGCFM}
  239.     INLINE $205F, $4E90;
  240.     {$ENDC}
  241.     
  242. TYPE
  243.     CMError = LONGINT;
  244.  
  245. { For 1.0 and 2.0 profile header variants }
  246. { CMAppleProfileHeader }
  247.     CMAppleProfileHeader = RECORD
  248.         CASE INTEGER OF
  249.         0: (
  250.             cm1:                        CMHeader;
  251.            );
  252.         1: (
  253.             cm2:                        CM2Header;
  254.            );
  255.     END;
  256.  
  257. { Param for CWConcatColorWorld(…) }
  258.     CMConcatProfileSet = RECORD
  259.         keyIndex:                INTEGER;                                { Zero-based }
  260.         count:                    INTEGER;                                { Min 1 }
  261.         profileSet:                ARRAY [0..0] OF CMProfileRef;            { Variable. Ordered from Source -> Dest }
  262.     END;
  263.  
  264. { ColorSync color data types }
  265.     CMRGBColor = RECORD
  266.         red:                    INTEGER;                                { 0..65535 }
  267.         green:                    INTEGER;
  268.         blue:                    INTEGER;
  269.     END;
  270.  
  271.     CMCMYKColor = RECORD
  272.         cyan:                    INTEGER;                                { 0..65535 }
  273.         magenta:                INTEGER;
  274.         yellow:                    INTEGER;
  275.         black:                    INTEGER;
  276.     END;
  277.  
  278.     CMCMYColor = RECORD
  279.         cyan:                    INTEGER;                                { 0..65535 }
  280.         magenta:                INTEGER;
  281.         yellow:                    INTEGER;
  282.     END;
  283.  
  284.     CMHLSColor = RECORD
  285.         hue:                    INTEGER;                                { 0..65535. Fraction of circle. Red at 0 }
  286.         lightness:                INTEGER;                                { 0..65535 }
  287.         saturation:                INTEGER;                                { 0..65535 }
  288.     END;
  289.  
  290.     CMHSVColor = RECORD
  291.         hue:                    INTEGER;                                { 0..65535. Fraction of circle. Red at 0 }
  292.         saturation:                INTEGER;                                { 0..65535 }
  293.         value:                    INTEGER;                                { 0..65535 }
  294.     END;
  295.  
  296.     CMLabColor = RECORD
  297.         L:                        INTEGER;                                { 0..65535 maps to 0..100 }
  298.         a:                        INTEGER;                                { 0..65535 maps to -128..127.996 }
  299.         b:                        INTEGER;                                { 0..65535 maps to -128..127.996 }
  300.     END;
  301.  
  302.     CMLuvColor = RECORD
  303.         L:                        INTEGER;                                { 0..65535 maps to 0..100 }
  304.         u:                        INTEGER;                                { 0..65535 maps to -128..127.996 }
  305.         v:                        INTEGER;                                { 0..65535 maps to -128..127.996 }
  306.     END;
  307.  
  308.     CMYxyColor = RECORD
  309.         capY:                    INTEGER;                                { 0..65535 maps to 0..1 }
  310.         x:                        INTEGER;                                { 0..65535 maps to 0..1 }
  311.         y:                        INTEGER;                                { 0..65535 maps to 0..1 }
  312.     END;
  313.  
  314.     CMGrayColor = RECORD
  315.         gray:                    INTEGER;                                { 0..65535 }
  316.     END;
  317.  
  318.     CMMultichannel5Color = RECORD
  319.         components:                ARRAY [0..4] OF SInt8;                    { 0..255 }
  320.     END;
  321.  
  322.     CMMultichannel6Color = RECORD
  323.         components:                ARRAY [0..5] OF SInt8;                    { 0..255 }
  324.     END;
  325.  
  326.     CMMultichannel7Color = RECORD
  327.         components:                ARRAY [0..6] OF SInt8;                    { 0..255 }
  328.     END;
  329.  
  330.     CMMultichannel8Color = RECORD
  331.         components:                ARRAY [0..7] OF SInt8;                    { 0..255 }
  332.     END;
  333.  
  334.     CMColor = RECORD
  335.         CASE INTEGER OF
  336.         0: (
  337.             rgb:                        CMRGBColor;
  338.            );
  339.         1: (
  340.             hsv:                        CMHSVColor;
  341.            );
  342.         2: (
  343.             hls:                        CMHLSColor;
  344.            );
  345.         3: (
  346.             XYZ:                        CMXYZColor;
  347.            );
  348.         4: (
  349.             Lab:                        CMLabColor;
  350.            );
  351.         5: (
  352.             Luv:                        CMLuvColor;
  353.            );
  354.         6: (
  355.             Yxy:                        CMYxyColor;
  356.            );
  357.         7: (
  358.             cmyk:                        CMCMYKColor;
  359.            );
  360.         8: (
  361.             cmy:                        CMCMYColor;
  362.            );
  363.         9: (
  364.             gray:                        CMGrayColor;
  365.            );
  366.         10: (
  367.             mc5:                        CMMultichannel5Color;
  368.            );
  369.         11: (
  370.             mc6:                        CMMultichannel6Color;
  371.            );
  372.         12: (
  373.             mc7:                        CMMultichannel7Color;
  374.            );
  375.         13: (
  376.             mc8:                        CMMultichannel8Color;
  377.            );
  378.     END;
  379.  
  380.     CMProfileSearchRecord = RECORD
  381.         header:                    CMHeader;
  382.         fieldMask:                LONGINT;
  383.         reserved:                ARRAY [0..1] OF LONGINT;
  384.     END;
  385.  
  386.     CMProfileSearchRecordPtr = ^CMProfileSearchRecord;
  387.     CMProfileSearchRecordHandle = ^CMProfileSearchRecordPtr;
  388.  
  389. { Search definition for 2.0 }
  390.     CMSearchRecord = RECORD
  391.         CMMType:                OSType;
  392.         profileClass:            OSType;
  393.         dataColorSpace:            OSType;
  394.         profileConnectionSpace:    OSType;
  395.         deviceManufacturer:        LONGINT;
  396.         deviceModel:            LONGINT;
  397.         deviceAttributes:        ARRAY [0..1] OF LONGINT;
  398.         profileFlags:            LONGINT;
  399.         searchMask:                LONGINT;
  400.         filter:                    CMProfileFilterUPP;
  401.     END;
  402.  
  403. { GetCWInfo structures }
  404.     CMMInfoRecord = RECORD
  405.         CMMType:                OSType;
  406.         CMMVersion:                LONGINT;
  407.     END;
  408.  
  409.     CMCWInfoRecord = RECORD
  410.         cmmCount:                LONGINT;
  411.         cmmInfo:                ARRAY [0..1] OF CMMInfoRecord;
  412.     END;
  413.  
  414.  
  415. CONST
  416.     cmNoColorPacking            = $0000;
  417.     cmAlphaSpace                = $0080;
  418.     cmWord5ColorPacking            = $0500;
  419.     cmLong8ColorPacking            = $0800;
  420.     cmLong10ColorPacking        = $0a00;
  421.     cmAlphaFirstPacking            = $1000;
  422.     cmOneBitDirectPacking        = $0b00;
  423.  
  424.     cmNoSpace                    = 0;
  425.     cmRGBSpace                    = 1;
  426.     cmCMYKSpace                    = 2;
  427.     cmHSVSpace                    = 3;
  428.     cmHLSSpace                    = 4;
  429.     cmYXYSpace                    = 5;
  430.     cmXYZSpace                    = 6;
  431.     cmLUVSpace                    = 7;
  432.     cmLABSpace                    = 8;
  433.     cmReservedSpace1            = 9;
  434.     cmGraySpace                    = 10;
  435.     cmReservedSpace2            = 11;
  436.     cmGamutResultSpace            = 12;
  437.     cmRGBASpace                    = cmRGBSpace + cmAlphaSpace;
  438.     cmGrayASpace                = cmGraySpace + cmAlphaSpace;
  439.     cmRGB16Space                = cmWord5ColorPacking + cmRGBSpace;
  440.     cmRGB32Space                = cmLong8ColorPacking + cmRGBSpace;
  441.     cmARGB32Space                = cmLong8ColorPacking + cmAlphaFirstPacking + cmRGBASpace;
  442.     cmCMYK32Space                = cmLong8ColorPacking + cmCMYKSpace;
  443.     cmHSV32Space                = cmLong10ColorPacking + cmHSVSpace;
  444.     cmHLS32Space                = cmLong10ColorPacking + cmHLSSpace;
  445.     cmYXY32Space                = cmLong10ColorPacking + cmYXYSpace;
  446.     cmXYZ32Space                = cmLong10ColorPacking + cmXYZSpace;
  447.     cmLUV32Space                = cmLong10ColorPacking + cmLUVSpace;
  448.     cmLAB32Space                = cmLong10ColorPacking + cmLABSpace;
  449.     cmGamutResult1Space            = cmOneBitDirectPacking + cmGamutResultSpace;
  450.  
  451.     
  452. TYPE
  453.     CMBitmapColorSpace = LONGINT;
  454.  
  455.     CMBitmap = RECORD
  456.         image:                    ^CHAR;
  457.         width:                    LONGINT;
  458.         height:                    LONGINT;
  459.         rowBytes:                LONGINT;
  460.         pixelSize:                LONGINT;
  461.         space:                    CMBitmapColorSpace;
  462.         user1:                    LONGINT;
  463.         user2:                    LONGINT;
  464.     END;
  465.  
  466. { Classic Print Manager Stuff }
  467.  
  468. CONST
  469.     enableColorMatchingOp        = 12;
  470.     registerProfileOp            = 13;
  471.  
  472. { PrGeneral parameter blocks }
  473.  
  474. TYPE
  475.     TEnableColorMatchingBlk = RECORD
  476.         iOpCode:                INTEGER;
  477.         iError:                    INTEGER;
  478.         lReserved:                LONGINT;
  479.         hPrint:                    THPrint;
  480.         fEnableIt:                BOOLEAN;
  481.     END;
  482.  
  483.     TRegisterProfileBlk = RECORD
  484.         iOpCode:                INTEGER;
  485.         iError:                    INTEGER;
  486.         lReserved:                LONGINT;
  487.         hPrint:                    THPrint;
  488.         fRegisterIt:            BOOLEAN;
  489.     END;
  490.  
  491.  
  492. CONST
  493.     cmNoProfileBase                = 0;
  494.     cmFileBasedProfile            = 1;
  495.     cmHandleBasedProfile        = 2;
  496.     cmPtrBasedProfile            = 3;
  497.  
  498.  
  499. TYPE
  500.     CMFileLocation = RECORD
  501.         spec:                    FSSpec;
  502.     END;
  503.  
  504.     CMHandleLocation = RECORD
  505.         h:                        Handle;
  506.     END;
  507.  
  508.     CMPtrLocation = RECORD
  509.         p:                        Ptr;
  510.     END;
  511.  
  512.     CMProfLoc = RECORD
  513.         CASE INTEGER OF
  514.         0: (
  515.             fileLoc:                    CMFileLocation;
  516.            );
  517.         1: (
  518.             handleLoc:                    CMHandleLocation;
  519.            );
  520.         2: (
  521.             ptrLoc:                        CMPtrLocation;
  522.            );
  523.     END;
  524.  
  525.     CMProfileLocation = RECORD
  526.         locType:                INTEGER;
  527.         u:                        CMProfLoc;
  528.     END;
  529.  
  530. { Profile file and element access }
  531.  
  532. FUNCTION CMOpenProfile(VAR prof: CMProfileRef; {CONST}VAR theProfile: CMProfileLocation): CMError;
  533.     {$IFC NOT GENERATINGCFM}
  534.     INLINE $203C, $0008, $001C, $ABEE;
  535.     {$ENDC}
  536. FUNCTION CMCloseProfile(prof: CMProfileRef): CMError;
  537.     {$IFC NOT GENERATINGCFM}
  538.     INLINE $203C, $0004, $001D, $ABEE;
  539.     {$ENDC}
  540. FUNCTION CMUpdateProfile(prof: CMProfileRef): CMError;
  541.     {$IFC NOT GENERATINGCFM}
  542.     INLINE $203C, $0004, $0034, $ABEE;
  543.     {$ENDC}
  544. FUNCTION CMNewProfile(VAR prof: CMProfileRef; {CONST}VAR theProfile: CMProfileLocation): CMError;
  545.     {$IFC NOT GENERATINGCFM}
  546.     INLINE $203C, $0008, $001B, $ABEE;
  547.     {$ENDC}
  548. FUNCTION CMCopyProfile(VAR targetProf: CMProfileRef; {CONST}VAR targetLocation: CMProfileLocation; srcProf: CMProfileRef): CMError;
  549.     {$IFC NOT GENERATINGCFM}
  550.     INLINE $203C, $000C, $0025, $0ABEE;
  551.     {$ENDC}
  552. FUNCTION CMGetProfileLocation(prof: CMProfileRef; VAR theProfile: CMProfileLocation): CMError;
  553.     {$IFC NOT GENERATINGCFM}
  554.     INLINE $203C, $0008, $003C, $0ABEE;
  555.     {$ENDC}
  556. FUNCTION CMValidateProfile(prof: CMProfileRef; VAR valid: BOOLEAN; VAR preferredCMMnotfound: BOOLEAN): CMError;
  557.     {$IFC NOT GENERATINGCFM}
  558.     INLINE $203C, $000C, $0026, $0ABEE;
  559.     {$ENDC}
  560. FUNCTION CMFlattenProfile(prof: CMProfileRef; flags: LONGINT; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  561.     {$IFC NOT GENERATINGCFM}
  562.     INLINE $203C, $0014, $0031, $0ABEE;
  563.     {$ENDC}
  564. FUNCTION CMUnflattenProfile(VAR resultFileSpec: FSSpec; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  565.     {$IFC NOT GENERATINGCFM}
  566.     INLINE $203C, $0010, $0032, $0ABEE;
  567.     {$ENDC}
  568. FUNCTION CMProfileElementExists(prof: CMProfileRef; tag: OSType; VAR found: BOOLEAN): CMError;
  569.     {$IFC NOT GENERATINGCFM}
  570.     INLINE $203C, $000C, $001E, $0ABEE;
  571.     {$ENDC}
  572. FUNCTION CMCountProfileElements(prof: CMProfileRef; VAR elementCount: LONGINT): CMError;
  573.     {$IFC NOT GENERATINGCFM}
  574.     INLINE $203C, $0008, $001F, $0ABEE;
  575.     {$ENDC}
  576. FUNCTION CMGetProfileElement(prof: CMProfileRef; tag: OSType; VAR elementSize: LONGINT; elementData: UNIV Ptr): CMError;
  577.     {$IFC NOT GENERATINGCFM}
  578.     INLINE $203C, $0010, $0020, $0ABEE;
  579.     {$ENDC}
  580. FUNCTION CMGetProfileHeader(prof: CMProfileRef; VAR header: CMAppleProfileHeader): CMError;
  581.     {$IFC NOT GENERATINGCFM}
  582.     INLINE $203C, $0008, $0039, $0ABEE;
  583.     {$ENDC}
  584. FUNCTION CMGetPartialProfileElement(prof: CMProfileRef; tag: OSType; offset: LONGINT; VAR byteCount: LONGINT; elementData: UNIV Ptr): CMError;
  585.     {$IFC NOT GENERATINGCFM}
  586.     INLINE $203C, $0014, $0036, $0ABEE;
  587.     {$ENDC}
  588. FUNCTION CMSetProfileElementSize(prof: CMProfileRef; tag: OSType; elementSize: LONGINT): CMError;
  589.     {$IFC NOT GENERATINGCFM}
  590.     INLINE $203C, $000C, $0038, $0ABEE;
  591.     {$ENDC}
  592. FUNCTION CMSetPartialProfileElement(prof: CMProfileRef; tag: OSType; offset: LONGINT; byteCount: LONGINT; elementData: UNIV Ptr): CMError;
  593.     {$IFC NOT GENERATINGCFM}
  594.     INLINE $203C, $0014, $0037, $0ABEE;
  595.     {$ENDC}
  596. FUNCTION CMGetIndProfileElementInfo(prof: CMProfileRef; index: LONGINT; VAR tag: OSType; VAR elementSize: LONGINT; VAR refs: BOOLEAN): CMError;
  597.     {$IFC NOT GENERATINGCFM}
  598.     INLINE $203C, $0014, $0021, $0ABEE;
  599.     {$ENDC}
  600. FUNCTION CMGetIndProfileElement(prof: CMProfileRef; index: LONGINT; VAR elementSize: LONGINT; elementData: UNIV Ptr): CMError;
  601.     {$IFC NOT GENERATINGCFM}
  602.     INLINE $203C, $0010, $0022, $0ABEE;
  603.     {$ENDC}
  604. FUNCTION CMSetProfileElement(prof: CMProfileRef; tag: OSType; elementSize: LONGINT; elementData: UNIV Ptr): CMError;
  605.     {$IFC NOT GENERATINGCFM}
  606.     INLINE $203C, $0010, $0023, $0ABEE;
  607.     {$ENDC}
  608. FUNCTION CMSetProfileHeader(prof: CMProfileRef; {CONST}VAR header: CMAppleProfileHeader): CMError;
  609.     {$IFC NOT GENERATINGCFM}
  610.     INLINE $203C, $0008, $003A, $0ABEE;
  611.     {$ENDC}
  612. FUNCTION CMSetProfileElementReference(prof: CMProfileRef; elementTag: OSType; referenceTag: OSType): CMError;
  613.     {$IFC NOT GENERATINGCFM}
  614.     INLINE $203C, $000C, $0035, $0ABEE;
  615.     {$ENDC}
  616. FUNCTION CMRemoveProfileElement(prof: CMProfileRef; tag: OSType): CMError;
  617.     {$IFC NOT GENERATINGCFM}
  618.     INLINE $203C, $0008, $0024, $0ABEE;
  619.     {$ENDC}
  620. FUNCTION CMGetScriptProfileDescription(prof: CMProfileRef; VAR name: Str255; VAR code: ScriptCode): CMError;
  621.     {$IFC NOT GENERATINGCFM}
  622.     INLINE $203C, $000C, $003E, $0ABEE;
  623.     {$ENDC}
  624. { Low-level matching functions }
  625. FUNCTION NCWNewColorWorld(VAR cw: CMWorldRef; src: CMProfileRef; dst: CMProfileRef): CMError;
  626.     {$IFC NOT GENERATINGCFM}
  627.     INLINE $203C, $000C, $0014, $0ABEE;
  628.     {$ENDC}
  629. FUNCTION CWConcatColorWorld(VAR cw: CMWorldRef; VAR profileSet: CMConcatProfileSet): CMError;
  630.     {$IFC NOT GENERATINGCFM}
  631.     INLINE $203C, $0008, $0015, $0ABEE;
  632.     {$ENDC}
  633. FUNCTION CWNewLinkProfile(VAR prof: CMProfileRef; {CONST}VAR targetLocation: CMProfileLocation; VAR profileSet: CMConcatProfileSet): CMError;
  634.     {$IFC NOT GENERATINGCFM}
  635.     INLINE $203C, $000C, $0033, $0ABEE;
  636.     {$ENDC}
  637. PROCEDURE CWDisposeColorWorld(cw: CMWorldRef);
  638.     {$IFC NOT GENERATINGCFM}
  639.     INLINE $203C, $0004, $0001, $0ABEE;
  640.     {$ENDC}
  641. FUNCTION CWMatchColors(cw: CMWorldRef; VAR myColors: CMColor; count: LONGINT): CMError;
  642.     {$IFC NOT GENERATINGCFM}
  643.     INLINE $203C, $000C, $0002, $0ABEE;
  644.     {$ENDC}
  645. FUNCTION CWCheckColors(cw: CMWorldRef; VAR myColors: CMColor; count: LONGINT; VAR result: LONGINT): CMError;
  646.     {$IFC NOT GENERATINGCFM}
  647.     INLINE $203C, $0010, $0003, $0ABEE;
  648.     {$ENDC}
  649. { Bitmap matching }
  650. FUNCTION CWMatchBitmap(cw: CMWorldRef; VAR bitmap: CMBitmap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr; VAR matchedBitmap: CMBitmap): CMError;
  651.     {$IFC NOT GENERATINGCFM}
  652.     INLINE $203C, $0010, $002C, $0ABEE;
  653.     {$ENDC}
  654. FUNCTION CWCheckBitmap(cw: CMWorldRef; {CONST}VAR bitmap: CMBitmap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr; VAR resultBitmap: CMBitmap): CMError;
  655.     {$IFC NOT GENERATINGCFM}
  656.     INLINE $203C, $0014, $002D, $0ABEE;
  657.     {$ENDC}
  658. { Quickdraw-specific matching }
  659. FUNCTION CWMatchPixMap(cw: CMWorldRef; VAR myPixMap: PixMap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr): CMError;
  660.     {$IFC NOT GENERATINGCFM}
  661.     INLINE $203C, $0010, $0004, $0ABEE;
  662.     {$ENDC}
  663. FUNCTION CWCheckPixMap(cw: CMWorldRef; VAR myPixMap: PixMap; progressProc: CMBitmapCallBackUPP; refCon: UNIV Ptr; VAR resultBitMap: BitMap): CMError;
  664.     {$IFC NOT GENERATINGCFM}
  665.     INLINE $203C, $0014, $0007, $0ABEE;
  666.     {$ENDC}
  667. FUNCTION NCMBeginMatching(src: CMProfileRef; dst: CMProfileRef; VAR myRef: CMMatchRef): CMError;
  668.     {$IFC NOT GENERATINGCFM}
  669.     INLINE $203C, $000C, $0016, $0ABEE;
  670.     {$ENDC}
  671. PROCEDURE CMEndMatching(myRef: CMMatchRef);
  672.     {$IFC NOT GENERATINGCFM}
  673.     INLINE $203C, $0004, $000B, $0ABEE;
  674.     {$ENDC}
  675. PROCEDURE NCMDrawMatchedPicture(myPicture: PicHandle; dst: CMProfileRef; VAR myRect: Rect);
  676.     {$IFC NOT GENERATINGCFM}
  677.     INLINE $203C, $000C, $0017, $0ABEE;
  678.     {$ENDC}
  679. PROCEDURE CMEnableMatchingComment(enableIt: BOOLEAN);
  680.     {$IFC NOT GENERATINGCFM}
  681.     INLINE $203C, $0002, $000D, $0ABEE;
  682.     {$ENDC}
  683. FUNCTION NCMUseProfileComment(prof: CMProfileRef; flags: LONGINT): CMError;
  684.     {$IFC NOT GENERATINGCFM}
  685.     INLINE $203C, $0008, $003B, $0ABEE;
  686.     {$ENDC}
  687. { System Profile access }
  688. FUNCTION CMGetSystemProfile(VAR prof: CMProfileRef): CMError;
  689.     {$IFC NOT GENERATINGCFM}
  690.     INLINE $203C, $0004, $0018, $0ABEE;
  691.     {$ENDC}
  692. FUNCTION CMSetSystemProfile({CONST}VAR profileFileSpec: FSSpec): CMError;
  693.     {$IFC NOT GENERATINGCFM}
  694.     INLINE $203C, $0004, $0019, $0ABEE;
  695.     {$ENDC}
  696. { External Profile Management }
  697. FUNCTION CMNewProfileSearch(VAR searchSpec: CMSearchRecord; refCon: UNIV Ptr; VAR count: LONGINT; VAR searchResult: CMProfileSearchRef): CMError;
  698.     {$IFC NOT GENERATINGCFM}
  699.     INLINE $203C, $0010, $0027, $0ABEE;
  700.     {$ENDC}
  701. FUNCTION CMUpdateProfileSearch(search: CMProfileSearchRef; refCon: UNIV Ptr; VAR count: LONGINT): CMError;
  702.     {$IFC NOT GENERATINGCFM}
  703.     INLINE $203C, $000C, $0028, $0ABEE;
  704.     {$ENDC}
  705. PROCEDURE CMDisposeProfileSearch(search: CMProfileSearchRef);
  706.     {$IFC NOT GENERATINGCFM}
  707.     INLINE $203C, $0004, $0029, $0ABEE;
  708.     {$ENDC}
  709. FUNCTION CMSearchGetIndProfile(search: CMProfileSearchRef; index: LONGINT; VAR prof: CMProfileRef): CMError;
  710.     {$IFC NOT GENERATINGCFM}
  711.     INLINE $203C, $000C, $002A, $0ABEE;
  712.     {$ENDC}
  713. FUNCTION CMSearchGetIndProfileFileSpec(search: CMProfileSearchRef; index: LONGINT; VAR profileFile: FSSpec): CMError;
  714.     {$IFC NOT GENERATINGCFM}
  715.     INLINE $203C, $000C, $002B, $0ABEE;
  716.     {$ENDC}
  717. { Utilities }
  718. FUNCTION CMGetColorSyncFolderSpec(vRefNum: INTEGER; createFolder: BOOLEAN; VAR foundVRefNum: INTEGER; VAR foundDirID: LONGINT): CMError;
  719.     {$IFC NOT GENERATINGCFM}
  720.     INLINE $203C, $000C, $0011, $0ABEE;
  721.     {$ENDC}
  722. FUNCTION CMGetCWInfo(cw: CMWorldRef; VAR info: CMCWInfoRecord): CMError;
  723.     {$IFC NOT GENERATINGCFM}
  724.     INLINE $203C, $000C, $001A, $0ABEE;
  725.     {$ENDC}
  726. { PS-related }
  727. FUNCTION CMGetPS2ColorSpace(srcProf: CMProfileRef; flags: LONGINT; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  728.     {$IFC NOT GENERATINGCFM}
  729.     INLINE $203C, $0014, $002E, $0ABEE;
  730.     {$ENDC}
  731. FUNCTION CMGetPS2ColorRenderingIntent(srcProf: CMProfileRef; flags: LONGINT; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  732.     {$IFC NOT GENERATINGCFM}
  733.     INLINE $203C, $0014, $002F, $0ABEE;
  734.     {$ENDC}
  735. FUNCTION CMGetPS2ColorRendering(srcProf: CMProfileRef; dstProf: CMProfileRef; flags: LONGINT; proc: CMFlattenUPP; refCon: UNIV Ptr; VAR preferredCMMnotfound: BOOLEAN): CMError;
  736.     {$IFC NOT GENERATINGCFM}
  737.     INLINE $203C, $0018, $0030, $0ABEE;
  738.     {$ENDC}
  739. FUNCTION CMGetPS2ColorRenderingVMSize(srcProf: CMProfileRef; dstProf: CMProfileRef; VAR vmSize: LONGINT; VAR preferredCMMnotfound: BOOLEAN): CMError;
  740.     {$IFC NOT GENERATINGCFM}
  741.     INLINE $203C, $0010, $003D, $0ABEE;
  742.     {$ENDC}
  743. { ColorSync 1.0 functions which have parallel 2.0 counterparts }
  744. FUNCTION CWNewColorWorld(VAR cw: CMWorldRef; src: CMProfileHandle; dst: CMProfileHandle): CMError;
  745.     {$IFC NOT GENERATINGCFM}
  746.     INLINE $203C, $000C, $0000, $0ABEE;
  747.     {$ENDC}
  748. FUNCTION ConcatenateProfiles(thru: CMProfileHandle; dst: CMProfileHandle; VAR newDst: CMProfileHandle): CMError;
  749.     {$IFC NOT GENERATINGCFM}
  750.     INLINE $203C, $000C, $000C, $0ABEE;
  751.     {$ENDC}
  752. FUNCTION CMBeginMatching(src: CMProfileHandle; dst: CMProfileHandle; VAR myRef: CMMatchRef): CMError;
  753.     {$IFC NOT GENERATINGCFM}
  754.     INLINE $203C, $000C, $000A, $0ABEE;
  755.     {$ENDC}
  756. PROCEDURE CMDrawMatchedPicture(myPicture: PicHandle; dst: CMProfileHandle; VAR myRect: Rect);
  757.     {$IFC NOT GENERATINGCFM}
  758.     INLINE $203C, $000C, $0009, $0ABEE;
  759.     {$ENDC}
  760. FUNCTION CMUseProfileComment(profile: CMProfileHandle): CMError;
  761.     {$IFC NOT GENERATINGCFM}
  762.     INLINE $203C, $0004, $0008, $0ABEE;
  763.     {$ENDC}
  764. PROCEDURE CMGetProfileName(myProfile: CMProfileHandle; VAR IStringResult: CMIString);
  765.     {$IFC NOT GENERATINGCFM}
  766.     INLINE $203C, $0008, $000E, $0ABEE;
  767.     {$ENDC}
  768. FUNCTION CMGetProfileAdditionalDataOffset(myProfile: CMProfileHandle): LONGINT;
  769.     {$IFC NOT GENERATINGCFM}
  770.     INLINE $203C, $0004, $000F, $0ABEE;
  771.     {$ENDC}
  772. { ProfileResponder functions }
  773. FUNCTION GetProfile(deviceType: OSType; refNum: LONGINT; aProfile: CMProfileHandle; VAR returnedProfile: CMProfileHandle): CMError;
  774.     {$IFC NOT GENERATINGCFM}
  775.     INLINE $203C, $0010, $0005, $0ABEE;
  776.     {$ENDC}
  777. FUNCTION SetProfile(deviceType: OSType; refNum: LONGINT; newProfile: CMProfileHandle): CMError;
  778.     {$IFC NOT GENERATINGCFM}
  779.     INLINE $203C, $000C, $0006, $0ABEE;
  780.     {$ENDC}
  781. FUNCTION SetProfileDescription(deviceType: OSType; refNum: LONGINT; deviceData: LONGINT; hProfile: CMProfileHandle): CMError;
  782.     {$IFC NOT GENERATINGCFM}
  783.     INLINE $203C, $0010, $0010, $0ABEE;
  784.     {$ENDC}
  785. FUNCTION GetIndexedProfile(deviceType: OSType; refNum: LONGINT; search: CMProfileSearchRecordHandle; VAR returnProfile: CMProfileHandle; VAR index: LONGINT): CMError;
  786.     {$IFC NOT GENERATINGCFM}
  787.     INLINE $203C, $0014, $0012, $0ABEE;
  788.     {$ENDC}
  789. FUNCTION DeleteDeviceProfile(deviceType: OSType; refNum: LONGINT; deleteMe: CMProfileHandle): CMError;
  790.     {$IFC NOT GENERATINGCFM}
  791.     INLINE $203C, $000C, $0013, $0ABEE;
  792.     {$ENDC}
  793. {$IFC OLDROUTINENAMES }
  794.  
  795. CONST
  796.     kMatchCMMType                = cmMatchCMMType;
  797.     kMatchApplProfileVersion    = cmMatchApplProfileVersion;
  798.     kMatchDataType                = cmMatchDataType;
  799.     kMatchDeviceType            = cmMatchDeviceType;
  800.     kMatchDeviceManufacturer    = cmMatchDeviceManufacturer;
  801.     kMatchDeviceModel            = cmMatchDeviceModel;
  802.     kMatchDeviceAttributes        = cmMatchDeviceAttributes;
  803.     kMatchFlags                    = cmMatchFlags;
  804.     kMatchOptions                = cmMatchOptions;
  805.     kMatchWhite                    = cmMatchWhite;
  806.     kMatchBlack                    = cmMatchBlack;
  807.  
  808. { types }
  809.     
  810. TYPE
  811.     CMYKColor = CMCMYKColor;
  812.  
  813.     CWorld = CMWorldRef;
  814.  
  815.     CMGamutResult = ^LONGINT;
  816.  
  817. { functions }
  818.  
  819. PROCEDURE EndMatching(myRef: CMMatchRef);
  820.     {$IFC NOT GENERATINGCFM}
  821.     INLINE $203C, $0004, $000B, $0ABEE;
  822.     {$ENDC}
  823. PROCEDURE EnableMatching(enableIt: BOOLEAN);
  824.     {$IFC NOT GENERATINGCFM}
  825.     INLINE $203C, $0002, $000D, $0ABEE;
  826.     {$ENDC}
  827. FUNCTION GetColorSyncFolderSpec(vRefNum: INTEGER; createFolder: BOOLEAN; VAR foundVRefNum: INTEGER; VAR foundDirID: LONGINT): CMError;
  828.     {$IFC NOT GENERATINGCFM}
  829.     INLINE $203C, $000C, $0011, $0ABEE;
  830.     {$ENDC}
  831. FUNCTION BeginMatching(src: CMProfileHandle; dst: CMProfileHandle; VAR myRef: CMMatchRef): CMError;
  832.     {$IFC NOT GENERATINGCFM}
  833.     INLINE $203C, $000C, $000A, $0ABEE;
  834.     {$ENDC}
  835. PROCEDURE DrawMatchedPicture(myPicture: PicHandle; dst: CMProfileHandle; VAR myRect: Rect);
  836.     {$IFC NOT GENERATINGCFM}
  837.     INLINE $203C, $000C, $0009, $0ABEE;
  838.     {$ENDC}
  839. FUNCTION UseProfile(profile: CMProfileHandle): CMError;
  840.     {$IFC NOT GENERATINGCFM}
  841.     INLINE $203C, $0004, $0008, $0ABEE;
  842.     {$ENDC}
  843. PROCEDURE GetProfileName(myProfile: CMProfileHandle; VAR IStringResult: CMIString);
  844.     {$IFC NOT GENERATINGCFM}
  845.     INLINE $203C, $0008, $000E, $0ABEE;
  846.     {$ENDC}
  847. FUNCTION GetProfileAdditionalDataOffset(myProfile: CMProfileHandle): LONGINT;
  848.     {$IFC NOT GENERATINGCFM}
  849.     INLINE $203C, $0004, $000F, $0ABEE;
  850.     {$ENDC}
  851. {$ENDC}
  852.  
  853. {$ALIGN RESET}
  854. {$POP}
  855.  
  856. {$SETC UsingIncludes := CMApplicationIncludes}
  857.  
  858. {$ENDC} {__CMAPPLICATION__}
  859.  
  860. {$IFC NOT UsingIncludes}
  861.  END.
  862. {$ENDC}
  863.